<template>
  <div>
    <EMFormRender :formInfo="formInfo"></EMFormRender>
  </div>
</template>

<script>
import EMFormRender from '@/components/Form/EMFormRender'
import { initForm } from '@/utils/form.em'
import { getForm } from '@/api/form'
export default {
  components: {
    EMFormRender
  },
  data() {
    return {
      formInfo: {}
    }
  },
  created() {
    const formId = this.$route.query.formId
    if (formId) {
      getForm(formId).then(data => {
        if (data.res) {
          this.formInfo = initForm(data.data)
        }
      })
    }
  },
  methods: {
  }
}
</script>
